Sketcher Workbench/bg

Sketcher workbench icon

Въведение

С Работна маса Sketcher могат да се създават 2D скици, предназначени за използване в други работни маси. 2D скиците са отправна точка за много CAD модели. Те обикновено определят профилите и пътищата за операции за създаване на 3D фигури. Моделът може да зависи от няколко скици за окончателната му форма.

Заедно с булеви операции, определени в Part Workbench, работната маса Sketcher, или по-кратко "The Sketcher", формира основата на метода за изграждане на твърди тела constructive solid geometry (CSG). Заедно с операциите от PartDesign Workbench, тя също формира основата на методологията Редактиране на функции за създаване на твърди тела. Но много други работни маси също използват скици.

Работната маса на Sketcher предоставя constraints (ограничения), което позволява на 2D фигурите да следват прецизни геометрични дефиниции по отношение на дължина, ъгли и взаимоотношения (хоризонталност, вертикалност, перпендикулярност и др.). Решаващата машина изчислява степента на ограниченост на 2D геометрията и позволява интерактивно изследване на степените на свобода на скицата.

Sketcher не е предназначена за създаване на 2D чертежи. След като скиците се използват във функция за генериране на тела, те се скриват автоматично и ограниченията се виждат само в режим на редактиране на скици. Ако трябва да правите само 2D изгледи за печат и не искате да създавате 3D модели, разгледайте Draft workbench.

Напълно ограничена скица

Ограничения (Constraints)

Ограниченията се използват за ограничаване на степените на свобода на даден обект. Например, линия без ограничения има 4 степени на свобода (съкращава се "DoF"): тя може да бъде преместена хоризонтално или вертикално, може да бъде разтегната и може да се завърти.

Прилагането на хоризонтално или вертикално ограничение или ъглово ограничение (спрямо друга линия или към една от осите) към линия ще ограничи възможността за въртене, като по този начин ще остави 3 степени на свобода. Заключването на една от точките по отношение на позиция ще премахне още 2 степени на свобода. И прилагането на ограничение за разстояние ще премахне последната степен на свобода. След това линията се счита за ""напълно ограничена".

Обектите могат да бъдат ограничени по отношение един към друг. Две линии могат да бъдат съединени през една от точките си със съвпадащо ограничение. Между тях може да се зададе ъгъл или да се зададе перпендикулярност. Една линия може да бъде допирателна към дъга или кръг, и така нататък. Скицата може да има редица различни решения и правенето ѝ ""напълно ограничена"" може да означава, че само едно от тези възможни решения е достигнато въз основа на приложените ограничения. Вижте също: Flipping.

Има два вида ограничения: геометрични и размерни. Те са подробно описани в раздела Tools по-долу.

Редактиране на ограничения

Когато се създава driving dimensional constraint (водещо размерно ограничение) и ако е отметната опция Ask for value after creating a dimensional constraint preference (по подразбиране е отметната), се отваря диалогов прозорец за редактиране на стойността ѝ.

Sketcher_Edit_Constraint.png

Можете да въведете цифрова стойност или expression и е възможно да зададете име на ограничението, за да улесните използването му в други изрази. Можете също да поставите отметка Референция, за да превключите ограничението в режим reference mode.

За да редактирате стойността на съществуващо ограничение на размер, направете едно от следните неща:

Позициониране на ограниченията

Ограниченията на размерите могат да бъдат премествани в 3D View чрез влачене. Задръжте натиснат левия бутон на мишката върху стойността на ограничението и преместете мишката. Символите на геометричните ограничения се позиционират автоматично и не могат да бъдат премествани.

Скици за профили

За да създадете скица, която може да се използва като профил за генериране на твърди тела, трябва да се следват определени правила:

  1. Скицата трябва да съдържа само затворени контури. Пропуските между крайните точки, колкото и да са малки, не са разрешени.
  2. Контурите могат да бъдат вложени, да създават кухини, но не трябва да се самопресичат или да пресичат други контури.
  3. Контурите не могат да споделят граници с други контури. Дублиращи или припокриващи се граници не са разрешени.
  4. T-връзките, които са повече от две граници, имащи обща точка, или точка, лежаща на граница, не са разрешени.

Невалидни скици:
1. Отворен контур (свободни крайни точки, подчертани от Validate Sketch tool)
2. Пресичане на контури
3. Дублиране на граници (крайни точки на припокриващи се граници, подчертани от Validate Sketch tool)
4. T-връзки

Тези правила не се прилагат за помощна геометрия (по подразбиране в цвят синьо), която не се показава извън режим на редактиране, или ако скицата се използва за различна цел. В зависимост от работната маса и инструмента, който ще използва скицата на профила, могат да се прилагат допълнителни ограничения.

Вътрешни лица

introduced in 1.0

Ако свойството ДанниMake Internals на скица е зададено на true вътрешни лица се генерират въз основа на ръбовете в скицата. Тези лица могат да бъдат избрани като затворени профили за операции. Пресичащите контури и Т-връзките са разрешени, те просто водят до допълнителни лица.

Инструменти

Инструментите на работна маса Sketcher се намират в менюто Sketch и/или върху няколко ленти с инструменти. Почти всички ленти с инструменти на Sketcher се показват само докато скицата е в режим на редактиране. Единственото изключение е лента Sketcher, която се показва само ако няма скица в режим на редактиране.

Някои инструменти също са достъпни от контекстното меню на 3D изгледа, докато скицата е в режим на редактиране или от контекстните менюта на Диалог Sketcher.

Ако скицата е в режим на редактиране, лентата Structure toolbar е скрита, тъй като никой от нейните инструменти не могат да се използват.

Общи

Лента Sketcher

Лента с инструменти по време редактиране

Други

Геометрия

Това са инструменти за създаване на геометрични обекти.

  • Create Arc:
  • Create Circle/Ellipse:
  • Ellipse From Center: Creates an ellipse from its center, an endpoint of one of its axes, and a point along the ellipse. introduced in 1.0: Or from both endpoints of one of its axes and a point along the ellipse.
  • Create Rectangle:
  • Rectangle: Creates a rectangle. introduced in 1.0: The tool has four modes. Rounded corners and creating an offset copy are optional features.
  • Create Polygon:
  • Square: Creates a square. Idem.
  • Octagon: Creates an octagon. Idem.
  • Polygon: Creates a regular polygon. The number of sides can be specified.
  • Create Slot:
  • Slot: Creates a slot.
  • B-Spline: Създава B-сплайн крива от контролни точки. introduced in 1.0: Или от възлови точки.
  • Periodic B-Spline: Създава периодична (затворена) крива на B-сплин от контролните точки. introduced in 1.0: Това е същият инструмент като B-Spline, но с различен първоначален режим.
  • B-Spline From Knots: Създава B-сплайн крива от възлови точки. Idem.
  • Periodic B-Spline From Knots: Създава периодична (затворена) B-сплайн крива от възлови точки. Idem.
  • Text: Creates text geometry controlled by a text constraint. This is an experimental feature that may change in future versions. introduced in 26.3
  • Toggle Construction Geometry: Either toggles the geometry creation tools to/from construction mode, or toggles selected geometry to/from construction geometry.

Ограничения (Constraints)

Това са инструменти за създаване на ограничения. Някои ограничения изискват използването на helper constraints.

  • Dimension: Е контекстно-чувствителен инструмент за ограничаване в Sketcher. Съобразно текущо селектирания елемент, той предлага подходящи ограничения на размерите, но и геометрични ограничения. introduced in 1.0
  • Horizontal Dimension: Фиксира хоризонталното разстояние между две точки или крайните точки на дадена линия. Ако една-единствена точка е предварително избрана, разстоянието е спрямо началото на координатната система на скицата.
  • Vertical Dimension: Фиксира вертикалното разстояние между две точки или крайните точки на дадена линия. Ако една-единствена точка е предварително избрана, разстоянието е спрямо началото на координатната система на скицата.
  • Distance Dimension: Фиксира дължината на една линия, разстоянието между две точки, перпендикулярното разстояние между точка и линия; или разстоянието между ръбовете на два кръга или дъгите, или между ръба на кръг или дъга и линия; или, introduced in 1.0, дължината на дъга.
  • Radius Dimension: Fixes the radius of circles, arcs and B-spline weight circles.
  • Angle Dimension: Fixes the angle between two edges, the angle of a line with the horizontal axis of the sketch, or the aperture angle of a circular arc.
  • Lock Position: Applies horizontal dimension and vertical dimension constraints to points. If a single point is selected the constraints reference the origin of the sketch. If two or more points are selected the constraints reference the last point in the selection.
  • Horizontal/Vertical Constraints:
  • Perpendicular Constraint: Constrains two lines to be perpendicular, or two edges, or an edge and an axis, to be perpendicular at their intersection. The constraint can also connect two edges, forcing them to be perpendicular at the joint.
  • Tangent/Collinear Constraint: Constrains two edges, or an edge and an axis, to be tangent. The constraint can also connect two edges, forcing them to be tangent at the joint. If two lines are selected they are made collinear.
  • Equal Constraint: Constrains edges to have an equal length (lines) or curvature (other edges except B-splines).
  • Symmetric Constraint: Constrains two points to be symmetrical around a line or axis, or around a third point.
  • Block Constraint: Blocks edges in place with a single constraint. It is mainly intended for B-splines.
  • Refraction Constraint: Constrains two lines to follow the law of refraction of light as it penetrates through an interface.
  • Toggle Constraints:
  • Toggle Driving/Reference Constraints: Toggles the dimensional constraint creation tools between driving and reference mode, or toggles selected dimensional constraints between those modes.

Sketcher Tools

  • Create Fillet/Chamfer:
  • Edit Edge:
  • Trim Edge: Trims an edge at the nearest intersections with other edges.
  • Split Edge: Splits an edge while transferring most constraints.
  • Extend Edge: Extends or shortens a line or an arc to an arbitrary location, or to a target edge or point.
  • External Geometry:
  • Carbon Copy: Copies all geometry and constraints from another sketch into the active sketch.
  • Mirror: Creates mirrored copies of selected elements.

B-Spline Tools

  • Insert Knot: Inserts a knot into a B-spline or increases the multiplicity of an existing knot.
  • Join Curves: Creates a B-spline by joining two existing B-splines or other edges.

Visual Helpers

  • Toggle B-Spline Information Layer:

Obsolete tools

  • Clone: Clones a Sketcher element. Not available in the default GUI in 1.0 and above. Can still be added to a custom toolbar.
  • Close shape: Creates a closed shape by applying coincident constraints to endpoints. Not available in 0.21 and above.
  • Corner-preserving fillet: Creates a fillet between two non-parallel lines while preserving their corner point. Not available in 1.0 and above.
  • Connect edges: Connect Sketcher elements by applying coincident constraints to endpoints. Not available in 0.21 and above.
  • Copy: Copies a Sketcher element. Not available in the default GUI in 1.0 and above. Can still be added to a custom toolbar.
  • External geometry: Projects edges and/or vertices belonging to objects outside the sketch onto the sketch plane. Not available in 1.1 and above.
  • Move: Moves the selected geometry taking as reference the last selected point. Not available in the default GUI in 1.0 and above. Can still be added to a custom toolbar.
  • Polyline (legacy tool): Creates a series of line and arc segments connected by their endpoints. Not available in the default GUI in 26.3 and above. Can still be added to a custom toolbar.
  • Rectangular array: Creates an array of selected Sketcher elements. Not available in the default GUI in 1.0 and above. Can still be added to a custom toolbar.

Preferences

Помощни средства за чертане

Работната маса на Sketcher има няколко помощни средства за чертане и други функции, които могат да помогнат при създаването на геометрия и прилагане на ограничения.

Непрекъснати режими

Има два непрекъснати режима: Geometry creation "Continue Mode" и Constraint creation "Continue Mode". Ако те са активирани (по подразбиране) в prereferences, свързаните инструменти ще се рестартират след всяка тяхна употреба. За да излезете от непрекъснат режим на инструмент натиснете Esc или десния бутон на мишката. Това трябва да се повтори, ако непрекъснат геометричен инструмент вече е получил вход. Можете също така да излезете от непрекъснат инструмент, като започнете друг инструмент за създаване на геометрия или ограничение. Обърнете внимание, че натискането на Esc ако няма активен инструмент, ще излезе от режим на редактиране на скици. Махнете отметката от клавиша Esc key can leave sketch edit mode preference, ако често неволно натискате Esc твърде много пъти.

Автоматични ограничения

В скици с поставена отметка Auto constraints (по подразбиране) няколко ограничения се прилагат автоматично при създаване или (introduced in 26.3) влачене на геометрия. Иконата на приложено автоматично ограничение е показана до курсора, когато е поставено правилно. След това лявото щракване или прекратяването на операцията за влачене чрез освобождаване на левия бутон на мишката ще приложи това ограничение. Това е настройка на скица, която може да бъде променена в Sketcher Dialog или чрез ВидAutoconstraints property на скицата.

Circular helpers

To create auto constraints along extended arcs circular helpers can be shown.

Linear helpers

Lines are automatically extended with helper lines if the cursor is positioned correctly. This allows creating point-on-object auto constraints along the line.

Directional helpers

Using a directional helper line to create a perpendicular auto constraint

If the Show directional autoconstraint helpers preference is selected (default), tangential, or perpendicular and parallel helper lines referencing a target edge can be shown while using the Polyline tool (only when creating line segments) and Line tool.

Note that straight target edges that are horizontal or vertical are ignored.

  1. Pick the first point of a new line (segment).
  2. If this point is auto constrained to be coincident with the endpoint of an existing line or circular arc, that edge will be the target edge. A previous segment of a polyline automatically becomes the target edge as well.
  3. If there is no target edge yet: hover an existing straight edge.
  4. A tangential helper line, or a perpendicular and a parallel helper line appear around the first point.
  5. Optionally change the target edge by hovering a different straight edge. This will realign the helper lines.
  6. Snap to a helper line to create a tangent, parallel or perpendicular constraint between the new line and the target edge.
  7. For a perpendicular constraint you can also pick a point on the target edge itself. In that case a point-on-object or a coincident constraint will be created as well.

Snapping

It is possible to snap to grid lines and grid intersection, and to snap to edges of geometry and midpoints of lines and arcs, and to certain angles. Please note that snapping does not produce constraints in and of itself. For example, only if Auto constraints is switched on will snapping to an edge produce a point-on-object constraint. But just picking a point on the edge would then have the same result.

On-View-Parameters

Depending on the selected option in the preferences only the dimensional On-View-Parameters or both the dimensional and the positional On-View-Parameters can be enabled. Positional parameters allow the input of exact coordinates, for example the center of a circle, or the start point of a line. Dimensional parameters allow the input of exact dimensions, for example the radius of a circle, or the length and angle of a line. On-View-Parameters are not available for all tools.

Determining the center point of a circle with the positional parameters enabled

Determining the radius of a circle with the dimensional parameters enabled

If values are entered and confirmed by pressing Enter or Tab, related constraints are added automatically. If two parameters are displayed at the same time, for example the X- and Y-coordinate of a point, it is possible to enter one value and pick a point to define the other. Depending on the object additional constraints may be required to fully constrain it. Constraints resulting from On-View-Parameters take precedence over those that may result from Auto constraints.

introduced in 26.3 If an OVP input has the focus you can hold down Alt to send key strokes to the 3D View instead.

Arc created by entering all On-View-Parameters with resulting automatically created constraints

Coordinate display

If the Show coordinates next to the cursor while editing preference is checked (default), the parameters of the current geometry tool (coordinates, radius, or length and angle) are displayed next to the cursor. This is deactivated while On-View-Parameters are shown.

Selection methods

While a sketch is in edit mode several selection methods can be used. introduced in 26.3: For all methods selection filters are taken into account.

3D View element selection

As elsewhere in FreeCAD, an element can be selected in the 3D View with a single left mouse click. But there is no need to hold down the Ctrl key when selecting multiple elements. Holding down that key is possible though and has the advantage that you can miss-click without losing the selection. Edges, points and constraints can be selected in this manner.

3D View box selection

Box selection in the 3D View works without using Std BoxSelection or Std BoxElementSelection:

  1. Make sure that no tool is active.
  2. Do one of the following:
    • Click in an empty area and drag a rectangle from left to right to select elements that lie completely inside the rectangle.
    • Click in an empty area and drag a rectangle from right to left to also select elements that touch or cross the rectangle.

You can box-select edges and points, constraints cannot be box-selected.

3D View connected geometry selection

Double-clicking an edge in the 3D View will select all edges directly and indirectly connected with that edge via endpoints. There is no need for the edges to be connected with coincident constraints, endpoints need only have the same coordinates.

Sketcher Dialog selection

Edges and points can also be selected from the Elements section of the Sketcher Dialog, and constraints from the Constraints section of that dialog.

Select All shortcut

To select everything within a sketch, use the standard keyboard shortcut Ctrl+A or the Edit → Select All option from the menu.

Copy, cut and paste

The standard keyboard shortcuts, Ctrl+C, Ctrl+X and Ctrl+V, can be used to copy, cut and paste selected Sketcher geometry including related constraints. But these tools are also available from the Sketch → Sketcher Tools menu. They can be used within the same sketch but also between different sketches or separate instances of FreeCAD. Since the data is copied to the clipboard in the form of Python code, it can be used in other ways too (e.g. shared on the forum).

Best practices

Every CAD user develops their own way of working over time, but there are some useful general principles to follow.

  • A series of simple sketches is easier to manage than a single complex one. For example, a first sketch can be created for the base 3D feature (a pad or a revolve for example), while a second one can contain holes or cutouts (pockets). Some details can be left out, to be realized later on as 3D features. You can choose to avoid fillets in your sketch if there are too many, and add them as a 3D feature.
  • Always create a closed profile, or your sketch won't produce a solid, but rather a set of open faces. If you don't want some of the objects to be included in the solid creation, turn them to construction elements with the Toggle Construction Geometry tool.
  • Use the Auto constraints feature to limit the number of constraints you'll have to add manually.
  • As a general rule, apply geometric constraints first, then dimensional constraints, and lock your sketch last. But remember: rules are made to be broken. If you're having trouble manipulating your sketch, it may be useful to constrain a few objects first before completing your profile.
  • If possible, center your sketch at the origin (0,0). If your sketch is not symmetric, locate one of its points at the origin.
  • If you have the possibility to choose between the distance dimension and the horizontal or vertical dimensions, prefer the latter. Horizontal and vertical dimensions are computationally cheaper.
  • In general, the best constraints to use are: horizontal and vertical constraints; horizontal and vertical dimensions; point-to-point tangent constraints. If possible, limit the use of these: distance dimension; edge-to-edge tangent constraint; point-on-object constraint; symmetric constraint.
  • If in doubt about the validity of a sketch once it is complete (features turn green), close the Sketcher Dialog and use Validate Sketch.

Обръщане

Явлението, че напълно ограничената скица, обикновено след голяма промяна в едно от нейните измерения, достига неволно ново състояние, е известно като "обръщане". В примера по-долу промяната на едно измерение напълно променя формата на скицата. Имайте предвид, че скицата с новата форма все още е напълно ограничена.

Оригинална скица (вляво) и същата скица след увеличаване на стойността от 20 мм до 1000 мм (вдясно)

Методи за намаляване на обръщането

Промяна на размерите на малки стъпки

Това не винаги е практично, но променянето на стойности на размери на по-малки стъпки могат да работят.

Използване на различно решаващо устройство

Решаващото устройство LevenbergMarquardt, което не е решаващото по подразбиране, е известно, че е по-малко склонно към обръщане. Вижте Sketcher Dialog за повече информация.

Използване на ограничения на хоризонтални и вертикални размери

Използване на horizontal и vertical Dimensions вместо distance dimensions или equal constraints може да предотврати обръщане. Точките, ограничени от тези размери, ще превключват местата само ако знакът за тяхната стойност е променен. На изображението над добавените (оранжеви) ограничения на размерите са свързани с оригиналните размери чрез expressions.

Използване на ограничения за ъгли

Използването на angle вместо horizontal и vertical ограничения също могат да работят. Ъгълът между ръбовете, ограничен от стойността на ъгъла, няма да се промени. 180° няма да стане 0°, 90° няма да стане 270° и т.н. На изображението всички хоризонтални и вертикални ограничения са заменени, но само подмяната на две вече е ефективна тук.

Учебници

Scripting

The Sketcher scripting page contains examples on how to create constraints from Python scripts.

Examples

For some ideas of what can be achieved with Sketcher tools, have a look at: Sketcher Examples.